﻿<UserControl x:Class="PathConverterSample.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converter="clr-namespace:PathConverter;assembly=PathConverter"
    Width="400" Height="300">
    <UserControl.Resources>
        <converter:StringToPathGeometryConverter x:Key="myConv"/>
    </UserControl.Resources>
    <Canvas x:Name="LayoutRoot" Background="PaleGoldenrod">
        <StackPanel Orientation="Vertical">
            <StackPanel Orientation="Horizontal">
                <TextBox x:Name="txtPath" Width="300" Height="25" FontSize="12" Margin="5" Text="{Binding pathText, Mode=TwoWay}" Background="Aqua"/>
                <Button x:Name="btnSubmit" Content="Convert Back" Width="80" Height="25" Margin="5" Click="btnSubmit_Click"/>
            </StackPanel>
            <TextBlock x:Name="tbPath" Width="300" Height="25" FontSize="12" Margin="5" Text="{Binding pathText, Mode=OneWay}" Foreground="Blue"/>            
        </StackPanel>
        <Path x:Name="path" Canvas.Left="10" Canvas.Top="30" Stroke="Black" Height="200" Width="200" Data="{Binding pathText, Converter={StaticResource myConv}}"/>
    </Canvas>
</UserControl>
